﻿var User = require("./userModel.js");

/**
 * 插入  
 */
function insert(i) {
    var username = "zhanggongze_"+parseInt(Math.random()*1000);
    var logindate = i;
 
    var user = new User({
        username : username,                 //用户账号
        userpwd: '11112',                            //密码
        userage: 27,                                //年龄
        logindate :logindate                      //最近登录时间
    });

    user.save(function (err, res) {

        if (err) {
            console.log("Error:" + err);
        }
        else {
            console.log("Res:" + res);
        }

    });
}

for (var i = 100; i > 0; i--) {
    insert(i);
}
